﻿using System;
using System.Linq;

class PrintMatrixes
{
    static void Main()
    {
        
        int matrixSize = int.Parse(Console.ReadLine());
        int[,] matrix = new int[matrixSize, matrixSize];

        for (int column = 0; column < matrix.GetLength(1); column++)
        {
            for (int row = 0; row < matrix.GetLength(0); row++)
            {
                matrix[column, row] = row * matrix.GetLength(1) + column + 1;

            }
        }


        for (int row = 0; row < matrix.GetLength(0); row++)
        {
            for (int col = 0; col < matrix.GetLength(1); col++)
            {
                Console.Write("{0}\t", matrix[row, col]);

            }
            Console.WriteLine();

        }
    }
}
